<?php
/**
 * Display a dropdown menu showing available versions and upon 
 * selection the description of that version on the right. There
 * may be more than one of these on a page so we have to be careful 
 * about assigning IDs.
 */
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
$version = $attribs['version'];
$popupId = $attribs['popupId'];
$vthtml = $attribs['vthtml'];
$infoboxId = $attribs['infoboxId'];
$mvd = $attribs['mvd'];
$longName = $attribs['longName'];
$jsFunctionName = $attribs['jsFunctionName'];
?>
<div id="infobox<?php echo $infoboxId;?>" class="infoBox">
<script type="text/javascript">
function <?php echo $jsFunctionName;?>()
{
	var menu = document.getElementById("<?php echo $popupId;?>");
    var version = document.getElementById("<?php echo 'version'.$infoboxId;?>");
    var parts = menu.options[menu.selectedIndex].id.split(".");
    version.value = parts[1];
	var taskField = document.getElementById("task");
	taskField.value = "";
    document.submission.submit();
}
</script>
<table><tr><td><?php echo $vthtml;?></td><td>
<span class="information"><?php echo $longName;?></span></td></tr></table>
<!-- submission fields -->
<input id="version<?php echo $infoboxId;?>" name="version<?php echo $infoboxId;?>" type="hidden" value="<?php echo $version;?>"></input>
<input id="name" name="name" type="hidden" value="<?php echo $mvd;?>"></input>
</div>

